// JavaScript Document
// JavaScript Document
function btnSearch_Click(){
	$.ajax({
		type:"GET",
		url:"http://127.0.0.1:8080/ajaxdemo/servicejsonp.php?number="+$("#keyword").val(),
		dataType:"jsonp",
		jsonp:"callback",
		success: function(responseJson){
			if (responseJson.success){
				$("#searchResult").html(responseJson.msg);
			}else{
				$("#searchResult").html("出现错误："+responseJson.msg);
		}},
		error: function(xmlHttpRequest){
			alert("error:"+xmlHttpRequest.status);}
	});	
}
function btnCreate_Click(){
	$.ajax({
		type:"POST",
		url:"servicejson.php",
		dataType:"jsonp",
		data:{
			name: $("#name").val(),
			number: $("#number").val(),
			sex: $("#sex").val(),
			job: $("#job").val()
		},
		success: function(responseJson){
			if (responseJson.success){
				$("#createResult").html(responseJson.msg);
			}else{
				$("#createResult").html("出现错误："+responseJson.msg);
			}
		},
		error: function(xmlHttpRequest){
			alert("error:"+xmlHttpRequest.status);
		}
	});
}